﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ExtendAdd.aspx.cs" Inherits="Customer_Profile.eCard.ExtendAdd" %>

<%@ Register Src="../mainTop.ascx" TagName="mainTop" TagPrefix="uc1" %>
<%@ Register assembly="DevExpress.Web.ASPxGridView.v9.3, Version=9.3.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxGridView" tagprefix="dx" %>
<%@ Register assembly="DevExpress.Web.ASPxEditors.v9.3, Version=9.3.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxEditors" tagprefix="dx" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<HTML>
	<HEAD>
		<title>UsergroupModify</title>
		<LINK href="/css/style.css" type="text/css" rel="stylesheet">
        <script language="javascript" type="text/javascript" src="/js/common.js"></script>
        <script language="javascript" type="text/javascript" src="/js/CalPopUp.js"></script>
            <script language="javascript">
                // <!CDATA[
                //function is called on changing focused row
                function OnGridFocusedRowChanged() {
                    // Query the server for the "EmployeeID" and "Notes" fields from the focused row 
                    // The values will be returned to the OnGetRowValues() function     
                    gridBank.GetRowValues(gridBank.GetFocusedRowIndex(), 'transfer_id;deal_no;card_no;account_name;bank_name;account_no;transfer_type;transfer_amount;to_account;transfer_date;remark', OnGetRowValues);
                }
                //Value array contains "EmployeeID" and "Notes" field values returned from the server 
                function OnGetRowValues(values) {
                    //txtAccountName..SetImageUrl("FocusedRow.aspx?Photo=" + values[0]);
                    account_name.SetText(values[3]);
                    account_no.SetText(values[5]);
                    to_account.SetText(values[8]);
                    bank_name.SetText(values[4]);
                    transfer_type.SetText(values[6]);
                    transfer_amount.SetText(values[7]);
                    transfer_date.SetText(values[9]);
                    remark.SetText(values[10]);

                    var transferid = document.getElementById("transfer_id");
                    transferid.value = values[0];
                }

                function checkok() {
                    var transferid = document.getElementById("transfer_id");
                    if (transferid.value == 'null' || transferid.value == '') {
                        alert("请先选择一行");
                        return false;
                    }
                    return confirm("你确认要删除吗？");
                }

                function calcAmount() {  //产品调整的时候用
                    var dropProdtext = document.getElementById("dropProd");
                    
                    var standDiscount = dropProdtext.options[dropProdtext.selectedIndex].text.split('|')[2].toString();

                    var realDiscount = document.getElementById("txtRealdiscount");
                    
                    var realAmount = document.getElementById("txtRealAmount");
                    var IncardAmount = document.getElementById("txtIncardAmount");
                    var AmountSpread = document.getElementById("txtSpread");
                    var AmountHQ = document.getElementById("txtHQ");
                    realDiscount.value = trim(standDiscount);

                    if (trim(realAmount.value) != '') {
                        var deincardAmount = parseFloat(realAmount.value / realDiscount.value);
                        IncardAmount.value = formatFloat(deincardAmount, 2);
                        deAmountHQ = parseFloat((realAmount.value / realDiscount.value) * standDiscount);
                        AmountHQ.value = formatFloat(deAmountHQ, 2);
                        AmountSpread.value = formatFloat(realAmount.value - AmountHQ.value, 2);
                    }
                }
                function calcAmount1() {   //金额调整的时候用，
                    var dropProdtext = document.getElementById("dropProd");
                    var standDiscount = dropProdtext.options[dropProdtext.selectedIndex].text.split('|')[2].toString();

                    var realDiscount = document.getElementById("txtRealdiscount");
                    var realAmount = document.getElementById("txtRealAmount");
                    var IncardAmount = document.getElementById("txtIncardAmount");
                    var AmountSpread = document.getElementById("txtSpread");
                    var AmountHQ = document.getElementById("txtHQ");

                    if (trim(realAmount.value) != '') {
                        var deincardAmount = parseFloat(realAmount.value / realDiscount.value);
                        IncardAmount.value = formatFloat(deincardAmount, 2);
                        deAmountHQ = parseFloat((realAmount.value / realDiscount.value) * standDiscount);
                        AmountHQ.value = formatFloat(deAmountHQ, 2);
                        AmountSpread.value = formatFloat(realAmount.value - AmountHQ.value, 2);
                    }
                }

                function checkDealSave() {
                    var ifagent = document.getElementById("checkAgentSale");
                    var cpartyno = document.getElementById("txtcpartyno").value;
                    if (ifagent.checked) {
                        var Cardno = document.getElementById("txtCardnoAgent").value;
                        var RealAmount = document.getElementById("txtAgentRealAmount").value;
                        var IncardAmount = document.getElementById("txtAgentIncardAmount").value;
                        var Realdiscount = document.getElementById("txtRealSaleDiscount").value;
                    }
                    else {
                        var Cardno = document.getElementById("txtCardno").value;
                        var RealAmount = document.getElementById("txtRealAmount").value;
                        var IncardAmount = document.getElementById("txtIncardAmount").value;
                        var Realdiscount = document.getElementById("txtRealdiscount").value;
                    }

                    if (cpartyno == '') {
                        alert("请先选择客户！");
                        return false;
                    }
                    if (Cardno == '') {
                        alert("请填写卡号！");
                        return false;
                    }
                    if (RealAmount == '') {
                        alert("请填写实收金额！");
                        return false;
                    }
                    if (IncardAmount == '') {
                        alert("请填写兑付金额！");
                        return false;
                    }
                    if (Realdiscount == '') {
                        alert("请填写真实折扣金额！");
                        return false;
                    }

                    //extend_amount
                    var dealnolist = new Array();
                    dealnolist = document.getElementById("hidExtendDealNo").value.split(',');

                    var hidextendalldate = document.getElementById("hidExtendAllDate");
                    var extendalldate_temp = "";
                    var totalExtendAmount = 0.00;
                    for (i = 0; i < dealnolist.length; i++) {
                        var extend_amount_dealnoid = document.getElementById("extend_amount_" + i.toString());
                        var extent_amount_temp = extend_amount_dealnoid.value;

                        var due_amount_dealnoid = document.getElementById("due_amount_" + i.toString());
                        var duel_amount_temp = due_amount_dealnoid.value;

                        var extend_balance_dealnoid = document.getElementById("extend_balance_" + i.toString());
                        if (extend_balance_dealnoid.value < 0) {
                            alert('原始卡交易余额不能小于0');
                            return false;
                        }
                        //extend_balance_dealnoid.value = formatFloat((parseFloat(duel_amount_temp) - parseFloat(extent_amount_temp)), 2).toString();

                        //totalExtendAmount = totalExtendAmount + parseFloat(extent_amount_temp);
                        extendalldate_temp += dealnolist[i] + "|" + extent_amount_temp + "|" + extend_balance_dealnoid.value + ",";
                    }

                    hidextendalldate.value = extendalldate_temp.substring(0, extendalldate_temp.length - 1);

                    return true;
                }

                function calcAmount_agent() { //产品调整的时候用
                    var dropProdtext = document.getElementById("dropProdAgent");
                    var standDiscount = dropProdtext.options[dropProdtext.selectedIndex].text.split('|')[2].toString();
                    var realDiscount = document.getElementById("txtRealSaleDiscount");
                    var realAmount = document.getElementById("txtAgentRealAmount");
                    var IncardAmount = document.getElementById("txtAgentIncardAmount");
                    var AmountSpread = document.getElementById("txtAgentSpread");
                    var AmountHQ = document.getElementById("txtAgentHQ");
                    realDiscount.value = trim(standDiscount);

                    if (trim(realAmount.value) != '') {
                        var deincardAmount = parseFloat(realAmount.value / realDiscount.value);
                        IncardAmount.value = formatFloat(deincardAmount, 2);
                        deAmountHQ = parseFloat((realAmount.value / realDiscount.value) * standDiscount);
                        AmountHQ.value = formatFloat(deAmountHQ, 2);
                        AmountSpread.value = formatFloat(realAmount.value - AmountHQ.value, 2);
                    }
                }
                function calcAmount1_agent() {   //金额调整的时候用
                    var dropProdtext = document.getElementById("dropProd");
                    var standDiscount = dropProdtext.options[dropProdtext.selectedIndex].text.split('|')[2].toString();
                    var realDiscount = document.getElementById("txtRealdiscount");
                    var realAmount = document.getElementById("txtRealAmount");
                    var IncardAmount = document.getElementById("txtIncardAmount");
                    var AmountSpread = document.getElementById("txtSpread");
                    var AmountHQ = document.getElementById("txtHQ");

                    if (trim(realAmount.value) != '') {
                        var deincardAmount = parseFloat(realAmount.value / realDiscount.value);
                        IncardAmount.value = formatFloat(deincardAmount, 2);
                        deAmountHQ = parseFloat((realAmount.value / realDiscount.value) * standDiscount);
                        AmountHQ.value = formatFloat(deAmountHQ, 2);
                        AmountSpread.value = formatFloat(realAmount.value - AmountHQ.value, 2);
                    }
                }

                function checkform() {
                    var transferid = document.getElementById("transfer_id");
                    if (transferid.value == 'null' || transferid.value == '') {
                        alert("请先选择一行");
                        return false;
                    }
                    return true;
                }

                function calcInitialAmount() {
                    //extend_amount
                    var dealnolist = new Array();
                    dealnolist = document.getElementById("hidExtendDealNo").value.split(',');

                    var hidextendalldate = document.getElementById("hidExtendAllDate");
                    var hidextendSumAmount = document.getElementById("hidExtendSumAmount");

                    var extendalldate_temp = "";
                    var totalExtendAmount = 0.00;
                    for (i = 0; i < dealnolist.length; i++) {
                        var extend_amount_dealnoid = document.getElementById("extend_amount_"+i.toString());
                        var extent_amount_temp = extend_amount_dealnoid.value;
                        
                        var due_amount_dealnoid = document.getElementById("due_amount_" + i.toString());
                        var duel_amount_temp = due_amount_dealnoid.value;

                        var extend_balance_dealnoid = document.getElementById("extend_balance_" + i.toString());
                        extend_balance_dealnoid.value = formatFloat((parseFloat(duel_amount_temp) - parseFloat(extent_amount_temp)), 2).toString();

                        totalExtendAmount = totalExtendAmount + parseFloat(extent_amount_temp);
                        //extendalldate_temp += dealnolist[i] + "|" + extent_amount_temp + "|" + extend_balance_dealnoid.value+",";            
                    }
                    hidextendSumAmount.value = totalExtendAmount;                    
                    //hidextendalldate.value = extendalldate_temp.substring(0, extendalldate_temp.length - 1);
                   
                    var ifagent = document.getElementById("checkAgentSale");
                    if (!ifagent.checked) {
                        var RealAmount = document.getElementById("txtRealAmount");
                        RealAmount.value = formatFloat(totalExtendAmount, 2);
                        RealAmount.fireEvent('onblur');
                    } else {
                        var RealAmount = document.getElementById("txtAgentRealAmount");
                        RealAmount.value = formatFloat(totalExtendAmount, 2);
                        RealAmount.fireEvent('onblur');
                    }
                }

                function checkDelete() {
                    return confirm("你确认要删除吗？删除后数据将无法找回！");
                }

                function checkSubmit() {                    
                    var value_amount = document.getElementById("txtRealAmount").value;                    
                    var transfer_amount = document.getElementById("hidSumAmount").value;                    
                    var hidextendSumAmount = document.getElementById("hidExtendSumAmount").value;                    
                    var sumTotal = parseFloat(transfer_amount) + parseFloat(hidextendSumAmount);

                    if (parseFloat(value_amount) - sumTotal !=0) {
                        return confirm("购买金额："+value_amount + " 不等于 汇款总额与展期总额合计" + sumTotal + "，你确认要提交到总部吗？可能会被打回。");
                    }
                    else {
                        return confirm("你确认要提交到交易总部吗？");
                    }
                }

                function filecheckok() {
                    var filepath = document.getElementById("FileUpload1");
                    if (filepath.value == 'null' || filepath.value == '') {
                        alert("请先选择要上传的文件");
                        return false;
                    }
                    var dealno = document.getElementById("hiddealno");
                    if (dealno.value == 'null' || dealno.value == '') {
                        alert("请先完成交易信息数据的保存后再上传附件!");
                        return false;
                    }
                    return true;
                }

                function keydown() {
                    if (event.keyCode == 13)
                        event.keyCode = 9
                }

                function GetPageRowValues() {
                    gridBank.GetPageRowValues("transfer_amount", GetPageRowValues_Callback);
                }
                function GetPageRowValues_Callback(result) {

                    var resiltStr = 0;
                    if (result.length > 0) {
                        for (var i = 0; i < result.length; i++) {
                            resiltStr += parseFloat(result[i].toString());
                        }
                    }
                    var hidSumAmount = document.getElementById("hidSumAmount");
                    hidSumAmount.value = resiltStr
                    //alert(resiltStr);                  
                }
    </script>
</HEAD>
	<body  bgcolor="#ffffff" leftmargin="0" topmargin="0" ><%--onload="javascritp:calcInitialAmount()"--%>
		<form id="Form1" method="post" runat="server" >           
			<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
				<tr>
					<td width="1" background="/images/dot_vline.gif"><img src="/images/spacer.gif" width="1" height="1"></td>
					<td width="15" valign="top"><img src="/images/spacer.gif" width="15" height="1"></td>
					<td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
							<tr>
								<td><img src="/images/spacer.gif" width="1" height="5"></td>
							</tr>
							<tr>
								<td height="23"><span class="navi-blk">
                                    <uc1:mainTop ID="MainTop1" runat="server" />
										个人旅行卡管理>交易管理>续存申请</span></td>
							</tr>
							<tr>
								<td background="/images/dot_hline.gif"><img src="/images/spacer.gif" width="1" height="1"></td>
							</tr>
						</table>
						<table width="100%" border="0" cellspacing="0" cellpadding="0">
							<tr>
								<td><img src="/images/spacer.gif" width="1" height="8"></td>
							</tr>
						</table>
						<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
							<tr>
								<td valign="top">
                                    <!--客户信息-->
									<table width="100%" border="0" cellspacing="0" cellpadding="0">
										<tr>
											<td bgcolor="#1765a7"><img src="/images/spacer.gif" width="1" height="3"></td>
										</tr>
										<tr>
											<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
													<tr>
														<td width="12" class="bglist1"><img src="/images/arw_blu_rgt.gif" width="4" height="7"></td>
														<td class="bglist1">用户信息</td>
													</tr>
												</table>
											</td>
										</tr>
										<tr>
											<td><img src="/images/spacer.gif" width="1" height="1"></td>
										</tr>
									</table>
                                
                                          <table width="100%" border="0" cellspacing="0" cellpadding="0">
										    <tr>
											    <td class="bglist-3"  width="10%">证件号码：</td>
											    <td class="bglist-4"  width="40%">
												    <input name="name" type="text" class="input2" id="txtsearchno" size="26" runat="server">
                                                    <asp:Button Text="搜" ID="serach" runat="server" class="button"  UseSubmitBehavior="false" 
                                                        onclick="serach_Click"/>
                                                    <input type="button" value="加" class="button" onclick="javascript:window.open('CpartyAdd.aspx');return false" />
                                                    <asp:TextBox ID="txtcpartyno" class="input2" size="5" runat="server" Enabled="false"></asp:TextBox>
											    </td>
											    <td class="bglist-3"  width="10%">购卡人(乙方)：</td>
											    <td class="bglist-4">
												    <input name="cparty_name" type="text" class="input2" id="txtName" size="20" runat="server" disabled=disabled>
                                                    <font color="red">注：合同签订方名称</font>                                            
											    </td>
										    </tr>
                                            <tr>
											    <td class="bglist-3">证件类型：</td>
											    <td class="bglist-4">
                                                    <asp:DropDownList ID="dropIDtype" runat=server Enabled="false" ></asp:DropDownList>
                                                    <input name="cparty_idcode" type="text" class="input2" id="txtIDcode" size="24" runat="server" disabled=disabled>
											    </td>
											    <td class="bglist-3">联系方式：</td>
											    <td class="bglist-4">
												    <input name="cparty_idcode" type="text" class="input2" id="txtPhone" size="12" runat="server" disabled=disabled>&nbsp;
                                                    <input name="cparty_idcode" type="text" class="input2" id="txtAddress" size="36" runat="server" disabled=disabled>
											    </td>
										    </tr>
                                       </table>                                   
                                   <!--交易信息-->
                                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
										<tr>
											<td bgcolor="#1765a7"><img src="/images/spacer.gif" width="1" height="3"></td>
										</tr>
										<tr>
											<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
													<tr>
														<td width="12" class="bglist1"><img src="/images/arw_blu_rgt.gif" width="4" height="7"></td>
														<td class="bglist1">原始交易信息</td>
													</tr>
												</table>
											</td>
										</tr>
										<tr>
											<td><img src="/images/spacer.gif" width="1" height="1"></td>
										</tr>
									</table>
                                    <table bordercolor="#c2d2e2" cellspacing="0" cellpadding="2" width="100%" border="1">
                                        <tr>
                                            <td>
                                                <table cellspacing="0" cellpadding="0" width="100%" border="0">
                                                    <tr>
                                                        <td bgcolor="#1765a7">
                                                            <img height="11" src="/images/pic_results.gif" width="61"></td>
                                                    </tr>
                                                </table>
                                                <asp:Repeater ID="rpt" runat="server" ClientIDMode="Static">
                                                    <HeaderTemplate>
                                                        <table width="100%" border="1">
                                                        <tr>
                                                            <td>交易号</td>
                                                            <td>卡号</td>
                                                            <td>客户姓名</td>
                                                            <td>产品名称</td>
                                                            <td>指定续存</td>
                                                            <td>续存说明</td>
                                                            <td>实收金额</td>
                                                            <td>销售折扣</td>
                                                            <td>兑付金额</td>
                                                            <td>交易余额</td>
                                                            <td>起息日</td>
                                                            <td>到期日</td>
                                                            <td>续存金额</td>
                                                            <td>余额</td>
                                                            <td>代理名称</td>
                                                        </tr>                                                        
                                                    </HeaderTemplate>
                                                    <ItemTemplate>
                                                        <tr>
                                                            <td> <%#Eval("deal_No") %> </td>
                                                            <td> <%#Eval("card_No") %> </td>
                                                            <td> <%#Eval("cparty_name") %></td>
                                                            <td> <%#Eval("procduct_name") %></td>
                                                            <td> <%#Eval("due_procduct_name") %></td>
                                                            <td> <%#Eval("due_prodremark") %></td>
                                                            <td> <%#Eval("initial_amount") %></td>
                                                            <td> <%#Eval("real_discount") %></td>
                                                            <td> <%#Eval("due_amount") %></td>
                                                            <td>
                                                                <asp:TextBox width="75" ID="due_amount" ClientIDMode="Predictable" runat="server" ReadOnly="true" Text=<%#Eval("balance_amount") %> ></asp:TextBox>
                                                            </td>
                                                            <td> <%#Eval("value_date") %></td>
                                                            <td> <%#Eval("due_date") %></td>
                                                            <td>
                                                                <asp:TextBox width="75" ID="extend_amount" ClientIDMode="Predictable" onkeydown="keydown();" onblur="calcInitialAmount()" runat="server" Text=<%#Eval("extend_amount") %> ></asp:TextBox>
                                                             </td>
                                                             <td>
                                                                <asp:TextBox width="75" ID="extend_balance" ClientIDMode="Predictable" ReadOnly="true" runat="server" Text=<%#Eval("old_deal_balance") %> ></asp:TextBox>
                                                             </td>
                                                            <td> <%#Eval("sale_agent_name") %></td>
                                                        </tr>
                                                    </ItemTemplate>
                                                    <FooterTemplate>
                                                        </table>
                                                    </FooterTemplate>
                                                </asp:Repeater>
                                                <asp:HiddenField ID="hidExtendDealNo" runat="server" />
                                                <asp:HiddenField ID="hidExtendAllDate" runat="server" />
                                                <asp:HiddenField ID="hidExtendSumAmount" runat="server" />
                                            </td>
                                        </tr>
                                    </table>
                                    <!--交易信息-->                                  
                                           <table width="100%" border="0" cellspacing="0" cellpadding="0">
										    <tr>
											    <td bgcolor="#1765a7"><img src="/images/spacer.gif" width="1" height="3"></td>
										    </tr>
										    <tr>
											    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
													    <tr>
														    <td width="12" class="bglist1"><img src="/images/arw_blu_rgt.gif" width="4" height="7"></td>
														    <td class="bglist1">
                                                            交易信息
                                                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                            <asp:CheckBox ID="checkAgentSale" Enabled="false" runat="server" Text="代理销售" AutoPostBack="True" oncheckedchanged="checkAgentSale_CheckedChanged" />
                                                            </td>
													    </tr>
												    </table>
											    </td>
										    </tr>
										    <tr>
											    <td><img src="/images/spacer.gif" width="1" height="1"></td>
										    </tr>
									    </table>
								    	   <table width="100%" border="0" cellspacing="0" cellpadding="0">										
                                            <tr>
                                                <td colspan="4">
                                                   <!--分子公司销售-->
                                                   <table width="100%" border="0" cellspacing="0" cellpadding="0" ID="tbNormal" runat="server">
                                                        <tr>
											                <td class="bglist-3" width="10%">产品名称：</td>
											                <td class="bglist-4" width="40%">
                                                                <asp:DropDownList ID="dropProd" runat="server" CssClass="input3" onchange="calcAmount();"></asp:DropDownList>&nbsp;
                                                                <asp:HiddenField ID="hiddealno" runat="server" />
											                </td>
                                                            <td class="bglist-3" width="10%">卡号：</td>
											                <td class="bglist-4" width="40%">
												                <input name="email" type="text" class="input2" id="txtCardno" size="36" runat="server">                                                              
											                </td>
										                </tr>
                                                        <tr>											            
											                <td class="bglist-3" width="10%">到期处理：</td>
											                    <td class="bglist-4" width="40%">
												                    <asp:DropDownList ID="dropDueProd" runat="server" CssClass="input3" ></asp:DropDownList>&nbsp;
											                </td>
                                                            <td class="bglist-3"  >到期说明：</td>
											                <td class="bglist-4">
												                <input name="email" type="text" class="input2" id="txtDueProdRemark" size="36" runat="server">
											                </td>
										                </tr>                                                    
                                                        <tr>
											                <td class="bglist-3"  >实收金额：</td>
											                <td class="bglist-4"  >
												                <input name="name" type="text" class="input2" id="txtRealAmount" size="18" onkeydown="keydown();" onblur="calcAmount1()" runat="server">
                                                                <input name="name" type="text" class="input2" id="txtHQ" size="18" runat="server" onkeydown="keydown();">
											                </td>
											                <td class="bglist-3"  >到期金额：</td>
											                <td class="bglist-4">
												                <input name="email" type="text" class="input2" readonly="readonly" onkeydown="keydown();" id="txtIncardAmount" size="36" runat="server">
											                </td>
										                </tr>
                                                        <tr>
                                                            <td class="bglist-3">实际折扣：</td>
											                <td class="bglist-4">
												                <input name="name" type="text" class="input2" id="txtRealdiscount" onkeydown="keydown();" size="36" onblur="calcAmount1()" runat="server">
											                </td>
											                <td class="bglist-3">金额差</td>
											                <td class="bglist-4">
                                                                <input name="name" type="text" readonly="readonly" onkeydown="keydown();" class="input2" id="txtSpread" size="36" runat="server">
											                </td>
										                </tr>            
                                                    </table>
                                                   <!--代理销售-->
                                                   <table width="100%" border="0" cellspacing="0" cellpadding="0" ID="tbAgentSale" runat="server">
                                                        <tr>
                                                            <td class="bglist-3"  width="10%">代理名称：</td>
											                <td class="bglist-4"  width="40%">												
                                                                <asp:DropDownList ID="dropAgentName" runat="server" CssClass="input3"></asp:DropDownList>
											                </td>
                                                            <td class="bglist-3"  width="10%">代理标准：</td>
											                <td class="bglist-4">												
                                                                <input name="name" type="text" class="input2" id="txtAgentDiscount" disabled="disabled" size="36" runat="server">
											                </td>
                                                        </tr>
                                                        <tr>
											                <td class="bglist-3"  width="10%">产品名称：</td>
											                <td class="bglist-4"  width="40%">												
                                                                <asp:DropDownList ID="dropProdAgent" runat="server" CssClass="input3" onchange="calcAmount1_agent();"></asp:DropDownList>&nbsp;                                                
                                                                <asp:HiddenField ID="HiddenField1" runat="server" />
											                </td>
                                                            <td class="bglist-3"  width="10%">卡号：</td>
											                <td class="bglist-4">
												                <input name="email" type="text" class="input2" id="txtCardnoAgent" size="36" runat="server">                                                               
											                </td>                                            
										                </tr>    
                                                        <tr>											            
											                <td class="bglist-3"  width="10%">到期处理：</td>
											                <td class="bglist-4">
												                <asp:DropDownList ID="dropDueProdAgent" runat="server" CssClass="input3"></asp:DropDownList>&nbsp;
											                </td>
                                                            <td class="bglist-3">到期提示：</td>
											                <td class="bglist-4">
												               <input name="email" type="text" class="input2" id="txtDueProdRemarkAgent" size="36" runat="server">
											                </td>
										                </tr>                                                
                                                        <tr>
											                <td class="bglist-3" >实收金额：</td>
											                <td class="bglist-4">
												                <input name="name" type="text" class="input2" id="txtAgentRealAmount" onkeydown="keydown();" size="18" runat="server" onblur="calcAmount_agent();">
                                                                <input name="name" type="text" class="input2" id="txtAgentHQ" onkeydown="keydown();" size="18" runat="server">
											                </td>
											                <td class="bglist-3">到期金额：</td>
											                <td class="bglist-4">
												                <input name="email" type="text" readonly="readonly" class="input2"  onkeydown="keydown();" id="txtAgentIncardAmount" size="36" runat="server">
											                </td>
										                </tr>
                                                        <tr>
                                                            <td class="bglist-3">实际折扣：</td>
											                <td class="bglist-4">
												                <input name="name" type="text" class="input2" onkeydown="keydown();" id="txtRealSaleDiscount" size="36" runat="server" onblur="calcAmount_agent();">
											                </td>
											                <td class="bglist-3">金额差</td>
											                <td class="bglist-4">
                                                                <input name="name" type="text" class="input2" readonly="readonly" id="txtAgentSpread" onkeydown="keydown();" size="36" runat="server">
											                </td>
										                </tr>

                                                    </table>
                                                </td>
                                            </tr>                                                                               
                                            <tr>
											    <td class="bglist-3" width="10%">销售地区：</td>
											    <td class="bglist-4" width="40%">
                                                    <asp:DropDownList ID="dropSaleEntity" Enabled="false" CssClass="input3" runat="server"></asp:DropDownList>
											    </td>
											   <td class="bglist-3" width="10%" rowspan=2>指定人：</td>
											    <td class="bglist-4" width="40%" rowspan=2>
                                                    <asp:TextBox ID="txtDesignee" runat="server" class="input1" Height=35 TextMode="MultiLine" Width=280></asp:TextBox>
											    </td>
										    </tr>
                                            <tr>
											    <td class="bglist-3" width="10%">销售人员：</td>
											    <td class="bglist-4" width="40%">
												    <input name="email" type="text" class="input2" id="txtDealer" size="36" runat="server">
											    </td>											    
										    </tr>
                                            <tr>
											    <td class="bglist-3">备注：</td>
											    <td class="bglist-4" >
												    <input name="name" type="text" class="input2" id="txtRemark" size="36" runat="server">
											    </td>
                                                <td class="bglist-3">退回原因：</td>
											        <td class="bglist-4" >
												        <input name="name" type="text" readonly class="input2" id="txtBackReason" size="36" runat="server">
											    </td>
										    </tr>
										    <tr>
                                                <td colspan="3" class="bglist-3">
                                                    <asp:Label id="lbWarning" runat="server" Text="提示信息：" ForeColor="Red"></asp:Label>
                                                </td>
											    <td class="bglist-4"><div align="right">
													    <asp:Button ID="btnDealSave" runat="server" class="button" Text="保存" OnClientClick="return checkDealSave();" 
                                                            onclick="btnDealSave_Click"  />&nbsp;                                                                         
												    </div>
											    </td>
										    </tr>
									    </table>                                    
                                    <!--汇款信息-->
                                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
										<tr>
											<td bgcolor="#1765a7"><img src="/images/spacer.gif" width="1" height="3"></td>
										</tr>
										<tr>
											<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
													<tr>
														<td width="12" class="bglist1"><img src="/images/arw_blu_rgt.gif" width="4" height="7"></td>
														<td class="bglist1">汇款信息</td>
													</tr>
												</table>
											</td>
										</tr>
										<tr>
											<td><img src="/images/spacer.gif" width="1" height="1"></td>
										</tr>
									</table>
                                   
                                            <table width="100%" border="1" cellspacing="0" cellpadding="0">
										        <tr>
											        <td colspan="4">
                                                        <dx:ASPxGridView ID="gridBank" ClientInstanceName="gridBank" runat="server"  
                                                            Width="100%" KeyFieldName="transfer_id" 
                                                            CssFilePath="~/App_Themes/Office2003Blue/{0}/styles.css" 
                                                            CssPostfix="Office2003Blue" AutoGenerateColumns="False">
                                                            <SettingsBehavior AllowFocusedRow="True"/>
                                                            <SettingsPager Mode="ShowAllRecords"></SettingsPager>
                                                            <ClientSideEvents FocusedRowChanged="function(s, e) { OnGridFocusedRowChanged(); }" Init="function(s, e) {	GetPageRowValues();}"/>                                                                  
                                                            <Images SpriteCssFilePath="~/App_Themes/Office2003Blue/{0}/sprite.css">
                                                                <LoadingPanelOnStatusBar Url="~/App_Themes/Office2003Blue/GridView/gvLoadingOnStatusBar.gif">
                                                                </LoadingPanelOnStatusBar>
                                                                <LoadingPanel Url="~/App_Themes/Office2003Blue/GridView/Loading.gif">
                                                                </LoadingPanel>
                                                            </Images>
                                                            <ImagesFilterControl>
                                                                <LoadingPanel Url="~/App_Themes/Office2003Blue/Editors/Loading.gif">
                                                                </LoadingPanel>
                                                            </ImagesFilterControl>
                                                            <Styles CssFilePath="~/App_Themes/Office2003Blue/{0}/styles.css" 
                                                                CssPostfix="Office2003Blue">
                                                                <Header ImageSpacing="5px" SortingImageSpacing="5px">
                                                                </Header>
                                                                <LoadingPanel ImageSpacing="10px">
                                                                </LoadingPanel>
                                                            </Styles>
                                                            <StylesEditors>
                                                                <ProgressBar Height="25px">
                                                                </ProgressBar>
                                                            </StylesEditors>
                                                            <Columns>                        
                                                                 <dx:GridViewDataColumn FieldName="transfer_id" VisibleIndex="1" Caption="编号" />                        
                                                                 <dx:GridViewDataColumn FieldName="deal_no" VisibleIndex="2" Caption="交易号" />                        
                                                                 <dx:GridViewDataColumn FieldName="card_no" VisibleIndex="3" Caption="卡号" />
                                                                 <dx:GridViewDataColumn FieldName="account_name" VisibleIndex="4" Caption="账户名称" />
                                                                 <dx:GridViewDataColumn FieldName="bank_name" VisibleIndex="5" Caption="银行名称" />
                                                                 <dx:GridViewDataColumn FieldName="account_no" VisibleIndex="6" Caption="银行账号" />
                                                                 <dx:GridViewDataColumn FieldName="transfer_type" VisibleIndex="7" Caption="付款类型" />
                                                                 <dx:GridViewDataColumn FieldName="transfer_amount" VisibleIndex="8" Caption="付款金额" />
                                                                 <dx:GridViewDataColumn FieldName="to_account" VisibleIndex="9" Caption="到账账户" />
                                                                 <dx:GridViewDataColumn FieldName="transfer_date" VisibleIndex="10" Caption="付款日期" />
                                                                 <dx:GridViewDataColumn FieldName="remark" VisibleIndex="11" Caption="备注" />
                                                             </Columns>
                                                        </dx:ASPxGridView>
                                                        <asp:HiddenField ID="hidSumAmount" runat="server" />                                                                              
                                                    </td>											
										        </tr>
                                                <tr>
										            <td>
                                                        账户名：<font color="red">*</font>
                                                        <asp:HiddenField ID="transfer_id" runat="server" />
                                                    </td>
                                                    <td>
                                                        <dx:ASPxTextBox ID="account_name" runat="server" size="30" ClientInstanceName="account_name"></dx:ASPxTextBox>
                                                    </td>
                                                    <td>
                                                        账户号：<font color="red">*</font>
                                                    </td>
                                                    <td>
                                                       <dx:ASPxTextBox ID="account_no" runat="server" size="30" ClientInstanceName="account_no"></dx:ASPxTextBox>
                                                    </td>
										        </tr>
                                                <tr>
										            <td>
                                                        银行名：<font color="red">*</font>
                                                    </td>
                                                    <td>
                                                       <dx:ASPxTextBox ID="bank_name" runat="server" size="30"  ClientInstanceName="bank_name"></dx:ASPxTextBox>
                                                    </td>
                                                    <td>
                                                        汇款类型：
                                                    </td>
                                                    <td>
                                                       <dx:ASPxComboBox ID="transfer_type" runat="server" ClientInstanceName="transfer_type">                                                       
                                                       </dx:ASPxComboBox>
                                                    </td>
										        </tr>
                                                <tr>
										            <td>
                                                        汇款金额：<font color="red">*</font>
                                                    </td>
                                                    <td>
                                                       <dx:ASPxTextBox ID="transfer_amount" runat="server" size="30"  ClientInstanceName="transfer_amount"></dx:ASPxTextBox>
                                                    </td>
                                                    <td>
                                                        转入账户：<font color="red">*</font>
                                                    </td>
                                                    <td>
                                                       <dx:ASPxComboBox ID="to_account" runat="server" ClientInstanceName="to_account">                                                       
                                                       </dx:ASPxComboBox>
                                                    </td>
										        </tr>
                                                <tr>
                                                    <td>
                                                       汇款时间： <font color="red">*</font>
                                                    </td>
                                                    <td>
                                                        <dx:ASPxDateEdit ID="transfer_date" runat="server">
                                                        </dx:ASPxDateEdit>                                                
                                                    </td>
                                                    <td>
                                                       备注： 
                                                    </td>
                                                    <td>
                                                        <dx:ASPxTextBox ID="remark" runat="server" size="30"  ClientInstanceName="remark"></dx:ASPxTextBox>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td colspan="4">
                                                        <asp:Label ID="lblTransferWarning" runat="server" Text="提示信息：" ForeColor="Red"></asp:Label>
                                                        <asp:Button ID="btnNew" runat="server" Text="新增" onclick="btnNew_Click"  UseSubmitBehavior="false"  />
                                                        &nbsp;&nbsp;&nbsp;&nbsp;
                                                        <asp:Button ID="btnEdit" runat="server" Text="修改" OnClientClick="return checkform()" onclick="btnEdit_Click"  />
                                                        &nbsp;&nbsp;&nbsp;&nbsp;
                                                        <asp:Button ID="btnDelete" runat="server" Text="删除" OnClientClick="return checkok();" onclick="btnDelete_Click" />
                                                    </td>
                                                </tr>
									        </table>                                     
                                    <!--附件信息-->
                                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
										<tr>
											<td bgcolor="#1765a7"><img src="/images/spacer.gif" width="1" height="3"></td>
										</tr>
										<tr>
											<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
													<tr>
														<td width="12" class="bglist1"><img src="/images/arw_blu_rgt.gif" width="4" height="7"></td>
														<td class="bglist1">附件信息</td>
													</tr>
												</table>
											</td>
										</tr>
										<tr>
											<td><img src="/images/spacer.gif" width="1" height="1"></td>
										</tr>
									</table>
                                    <table width="100%" border="0" cellpadding="0" cellspacing="0">
                                        <tr>
											<td bgcolor="#1765a7"><img src="/images/spacer.gif" width="1" height="3"></td>
										</tr>
                                        <tr>
                                            <td>
                                            <table width="100%" border="0" cellpadding="0" cellspacing="0">
                                                <tr>                                                   
                                                    <td  width="75%">
                                                        <dx:ASPxGridView ID="gridAttach" runat="server" Width="100%" 
                                                            CssFilePath="~/App_Themes/Office2003Blue/{0}/styles.css" 
                                                            CssPostfix="Office2003Blue" 
                                                            oncustombuttoncallback="gridAttach_CustomButtonCallback">
                                                            <SettingsPager Mode="ShowAllRecords"></SettingsPager>
                                                            <Images SpriteCssFilePath="~/App_Themes/Office2003Blue/{0}/sprite.css">
                                                                <LoadingPanelOnStatusBar Url="~/App_Themes/Office2003Blue/GridView/gvLoadingOnStatusBar.gif">
                                                                </LoadingPanelOnStatusBar>
                                                                <LoadingPanel Url="~/App_Themes/Office2003Blue/GridView/Loading.gif">
                                                                </LoadingPanel>
                                                            </Images>
                                                            <ImagesFilterControl>
                                                                <LoadingPanel Url="~/App_Themes/Office2003Blue/Editors/Loading.gif">
                                                                </LoadingPanel>
                                                            </ImagesFilterControl>
                                                            <Styles CssFilePath="~/App_Themes/Office2003Blue/{0}/styles.css" 
                                                                CssPostfix="Office2003Blue">
                                                                <Header ImageSpacing="5px" SortingImageSpacing="5px">
                                                                </Header>
                                                                <LoadingPanel ImageSpacing="10px">
                                                                </LoadingPanel>
                                                            </Styles>
                                                            <StylesEditors>
                                                                <ProgressBar Height="25px">
                                                                </ProgressBar>
                                                            </StylesEditors> 
                                                            <Columns>
                                                                <dx:GridViewDataColumn FieldName="attach_id" VisibleIndex="1" Caption="ID" />
                                                                <dx:GridViewDataColumn FieldName="deal_no" VisibleIndex="2" Caption="交易号" />
                                                                <dx:GridViewDataColumn Caption="显示名称" VisibleIndex="3">
                                                                    <DataItemTemplate>
                                                                        <a href='<%#Eval("attach_url") %>' target="_blank" ><%#Eval("view_name")%></a>
                                                                    </DataItemTemplate>
                                                                </dx:GridViewDataColumn>
                                                                <dx:GridViewDataColumn FieldName="attach_name" VisibleIndex="4" Caption="附件名称" />
                                                                <dx:GridViewDataColumn FieldName="attach_type" VisibleIndex="5" Caption="附件类别" />
                                                                <dx:GridViewDataColumn FieldName="attach_size" VisibleIndex="6" Caption="大小" />
                                                                <dx:GridViewCommandColumn VisibleIndex="7" Caption="删除">
                                                                    <CustomButtons>
                                                                        <dx:GridViewCommandColumnCustomButton Text="删除" ID="Delete" />
                                                                    </CustomButtons>
                                                                </dx:GridViewCommandColumn>
                                                            </Columns>                                                        
                                                        </dx:ASPxGridView>                                                        
                                                    </td>
                                                    <td width="30%">
                                                       选择文件：<asp:FileUpload ID="FileUpload1" runat="server" /><br />
                                                       <asp:Button ID="btnUpload" Text="上传" runat="server" OnClientClick="return filecheckok();" onclick="btnUpload_Click"  />
                                                    </td>
                                                </tr>
                                            </table>                                                
                                            </td>
                                        </tr>
                                    </table>
                                    <!--提交信息-->
                                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
										<tr>
											<td bgcolor="#1765a7"><img src="/images/spacer.gif" width="1" height="3"></td>
										</tr>
                                        <tr>
                                            <td>
                                                <asp:Label ID="lblSubmitWarning" runat="server" Text="提示信息："></asp:Label>
                                                <asp:Button ID="btnSubmit" runat="server" Text="提交信息到总部" OnClientClick="return checkSubmit();"  onclick="btnSubmit_Click"  />&nbsp;&nbsp;
                                                <asp:Button ID="btnCancel" runat="server" Text="删除本笔交易" OnClientClick="return checkDelete();" onclick="btnCancel_Click" />
                                            </td>
                                        </tr>
                                    </table>
								</td>
							</tr>
						</table>
					</td>
					<td width="10" valign="top"><img src="/images/spacer.gif" width="10" height="1"></td>
				</tr>
			</table>
            <% =strScript %>
		</form>
	</body>
</HTML>